﻿<%@ Page Title="" Language="C#" MasterPageFile="~/CRMMaster.Master" AutoEventWireup="true" CodeBehind="CustomerContacts.aspx.cs" Inherits="FinalCRM.PhyuSin.CustomerContacts" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTabControl" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" 
        Height="679px" style="margin-right: 0px" Width="669px" 
        onactivetabchanged="ASPxPageControl1_ActiveTabChanged">
        <TabPages>
            <dx:TabPage Text="Create Customer Contact">
                <ContentCollection>
                    <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                        &nbsp;&nbsp;<asp:Label ID="lblCreateCustomerID" runat="server" Text="Customer ID"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="txtCreateCustomerID" runat="server"></asp:TextBox>
                        <br />
                        <br />
                        <br />
                        &nbsp;
                        <asp:Label ID="lblCreateTitle" runat="server" Text="Title"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtCreateTitle" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RfvCreateTitle" runat="server" 
                            ControlToValidate="txtCreateTitle" ErrorMessage="Title is required!" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
&nbsp;
                        <asp:Label ID="lblCreateAccountName" runat="server" Text="Customer Name"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox 
                            ID="txtCreateCustomerName" runat="server"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator ID="RfvCreateCustomerName" runat="server" 
                            ControlToValidate="txtCreateCustomerName" 
                            ErrorMessage="Customer Name is required!" ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />&nbsp;<br /> <br />
                        &nbsp;
                        <asp:Label ID="lblCreateOfficePhone" runat="server" Text="Office Phone"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtCreateOfficePhone" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RfvCreateOfficePhone" runat="server" 
                            ControlToValidate="txtCreateOfficePhone" 
                            ErrorMessage="Office Phone is required!" ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <br />
                        &nbsp;
                        <asp:Label ID="lblCreateMobile" runat="server" Text="Mobile"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtCreateMobile" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RfvCreateMobile" runat="server" 
                            ControlToValidate="txtCreateMobile" ErrorMessage="Mobile is required!" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <br />
                        &nbsp;
                        <asp:Label ID="lblCreateFax" runat="server" Text="Fax"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtCreateFax" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RfvCreateFax" runat="server" 
                            ControlToValidate="txtCreateFax" ErrorMessage="Fax is required!" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <br />
                        &nbsp;
                        <asp:Label ID="lblCreateEmail" runat="server" Text="Email"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtCreateEmail" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RfvCreateEmail" runat="server" 
                            ControlToValidate="txtCreateEmail" ErrorMessage="Email is required!" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
&nbsp;
                        <asp:Label ID="lblCreateCustomerAddress" runat="server" Text="Customer Address"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtCreateCustomerAddress" runat="server" TextMode="MultiLine"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RfvCreateCustomerAddress" runat="server" 
                            ControlToValidate="txtCreateCustomerAddress" 
                            ErrorMessage="Customer Address is required!" ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <br />
                        <br />
                        &nbsp;
                        <asp:Label ID="lblCreateCompanyName" runat="server" Text="Company Name"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:DropDownList ID="ddlCreateCompanyName" runat="server">
                            <asp:ListItem>ABC</asp:ListItem>
                            <asp:ListItem>DEF</asp:ListItem>
                            <asp:ListItem>GHI</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RfvCreateCompanyName" runat="server" 
                            ControlToValidate="ddlCreateCompanyName" 
                            ErrorMessage="Company Name cannot be empty!" ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <br />
                        &nbsp;
                        <asp:Label ID="lblCreateUserName" runat="server" Text="User Name"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:DropDownList ID="ddlCreateUserName" runat="server">
                            <asp:ListItem>Phyu Sin</asp:ListItem>
                            <asp:ListItem>Grace</asp:ListItem>
                            <asp:ListItem>Mary</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RfvCreateUserName" runat="server" 
                            ControlToValidate="ddlCreateUserName" ErrorMessage="User Name cannot be empty!" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <br />
&nbsp;
                        <asp:Label ID="lblCreateAccountID" runat="server" Text="Account ID"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:DropDownList ID="ddlCreateAccountID" runat="server">
                            <asp:ListItem>1</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RfvCreateAccountID" runat="server" 
                            ControlToValidate="ddlCreateAccountID" 
                            ErrorMessage="Account ID cannot be empty!" ForeColor="Red"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <br />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnCreate" runat="server" Text="Create" 
                            OnClick="btnCreate_Click" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
                    </dx:ContentControl>
                </ContentCollection>
            </dx:TabPage>
            <dx:TabPage Text="View Customer Contact">
                <ContentCollection>
                    <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                        <asp:GridView ID="GridView4" runat="server" AllowPaging="True" 
                            AllowSorting="True" DataSourceID="dsViewCustomerContact">
                        </asp:GridView>
                        <br />
                        <asp:ObjectDataSource ID="dsViewCustomerContact" runat="server" 
                            SelectMethod="viewCustomerContact" 
                            TypeName="FinalCRM.App_Code.CustomerContactBusiness" 
                            DataObjectTypeName="FinalCRM.App_Code.CustomerContactBusiness" 
                            InsertMethod="createCustomerContact">
                        </asp:ObjectDataSource>
                    </dx:ContentControl>
                </ContentCollection>
            </dx:TabPage>
            <dx:TabPage Text="Update Customer Contact">
                <ContentCollection>
                    <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                        <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                            DataSourceID="dsUpdateCustomerContact" AutoGenerateColumns="False">
                            <Columns>
                                <asp:CommandField ButtonType="Button" ShowEditButton="True" />
                                <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" />
                                <asp:BoundField DataField="Title" HeaderText="Title" />
                                <asp:BoundField DataField="CustomerName" HeaderText="CustomerName" />
                                <asp:BoundField DataField="OfficePhone" HeaderText="OfficePhone" />
                                <asp:BoundField DataField="Mobile" HeaderText="Mobile" />
                                <asp:BoundField DataField="Fax" HeaderText="Fax" />
                                <asp:BoundField DataField="Email" HeaderText="Email" />
                                <asp:BoundField DataField="CustomerAddress" HeaderText="CustomerAddress" />
                                <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
                                <asp:BoundField DataField="UserName" HeaderText="UserName" />
                                <asp:BoundField DataField="AccountID" HeaderText="AccountID" />
                            </Columns>
                        </asp:GridView>
                        <br />
                        <br />
                        <asp:ObjectDataSource ID="dsUpdateCustomerContact" runat="server" 
                            DataObjectTypeName="FinalCRM.App_Code.CustomerContactBusiness" 
                            InsertMethod="createCustomerContact" SelectMethod="viewCustomerContact" 
                            TypeName="FinalCRM.App_Code.CustomerContactBusiness" 
                            UpdateMethod="updateCustomerContact"></asp:ObjectDataSource>
                    </dx:ContentControl>
                </ContentCollection>
            </dx:TabPage>
            <dx:TabPage Text="Delete Customer Contact">
                <ContentCollection>
                    <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                        <asp:GridView ID="GridView3" runat="server" AllowPaging="True" 
                            AllowSorting="True" DataSourceID="dsDeleteCustomerContact">
                            <Columns>
                                <asp:CommandField ButtonType="Button" ShowDeleteButton="True" />
                            </Columns>
                        </asp:GridView>
                        <br />
                        <br />
                        <asp:ObjectDataSource ID="dsDeleteCustomerContact" runat="server" 
                            DataObjectTypeName="FinalCRM.App_Code.CustomerContactBusiness" 
                            DeleteMethod="deleteCustomerContacts" InsertMethod="createCustomerContact" 
                            OldValuesParameterFormatString="original_{0}" 
                            SelectMethod="viewCustomerContact" 
                            TypeName="FinalCRM.App_Code.CustomerContactBusiness" 
                            UpdateMethod="updateCustomerContact"></asp:ObjectDataSource>
                    </dx:ContentControl>
                </ContentCollection>
            </dx:TabPage>
        </TabPages>
    </dx:ASPxPageControl>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
</asp:Content>
